<template>
	<div>
	<el-row>
		<el-button type="primary" round @click="dialogTableVisible = true">详情</el-button>
		<el-button type="warning" round @click='dialogformVisible= true'>查看商品</el-button>
		<el-button type="warning" round>经营分析</el-button>
	</el-row>
	<el-dialog title="物品详情" :visible.sync="dialogTableVisible">
	  <el-table :data="gridData">
	    <el-table-column property="today" label="生产日期" width="150"></el-table-column>
	    <el-table-column property="name" label="物品名称" width="200"></el-table-column>
	    <el-table-column property="expirationdate" label="保质期" width="200"></el-table-column>
		<el-table-column property="manufacturer" label="生产厂家" width="200"></el-table-column>
		<el-table-column property="productionaddress" label="生产地址" width="200"></el-table-column>
	  </el-table>
	</el-dialog>
	<el-dialog title="物品详情" :visible.sync="dialogformVisible">
	  <el-table :data="formData">
	    <el-table-column property="productID" label="商品编号" width="100"></el-table-column>
	    <el-table-column property="belongs" label="所属店铺" width="100"></el-table-column>
	    <el-table-column property="image" label="商品图" width="100"></el-table-column>
		<el-table-column property="productname" label="商品名称" width="100"></el-table-column>
		<el-table-column property="type" label="商品类型" width="100"></el-table-column>
		<el-table-column property="price" label="成本价" width="100"></el-table-column>
		<el-table-column property="originalprice" label="原价" width="100"></el-table-column>
		<el-table-column property="salesprice" label="销售价" width="100"></el-table-column>
		<el-table-column property="repertory" label="库存量" width="100"></el-table-column>
		<el-table-column property="monthlysale" label="月销量" width="100"></el-table-column>
		<el-table-column property="monthlysales" label="月销售额" width="100"></el-table-column>
		<el-table-column property="button" label="操作" width="200">
			<el-button type="primary">下架</el-button>
			<el-button type='danger' @click='handleClose()'>删除</el-button>
		</el-table-column>
	  </el-table>
	</el-dialog>
	</div>
</template>

<script>
	export default {
		// props:{
		// 	dialogTableVisible:{
		// 		required: true,
		// 		type:Boolean,
		// 		default:false
		// 	}
		// },
		data() {
			return{
				gridData:[
					{
						today:'2016-05-01',
						name:'金坷垃',
						expirationdate:'12'+'月',
						manufacturer:'湖南黑马传智播客',
						productionaddress:'东方红大厦五楼'
					},
				],
				dialogTableVisible:false,
				dialogformVisible:false,
				formData:[{
					productID:'1',
					belongs:'传智播客',
					image:'image',
					productname:'猪肉',
					type:'食物',
					price:'2',
					originalprice:15.5,
					salesprice:20,
					repertory:200,
					monthlysale:50,
					monthlysales:500
				}],
				dialogVisibles:false,
			}
		},
		 methods: {
		      handleClose() {
		        this.$confirm('确认删除？')
				try{
				this.formData=[{}]
				console.log(2)
				}catch(err){
					//TODO handle the exception
					console.log('good')
				}
		      }
		    }
}
	
</script>

<style scoped>

</style>
